<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
				xmlns:ui="http://java.sun.com/jsf/facelets"
				xmlns:h="http://java.sun.com/jsf/html"
				xmlns:a4j="http://richfaces.org/a4j"
				xmlns:rich="http://richfaces.org/rich"
				xmlns:f="http://java.sun.com/jsf/core"
				xmlns:c="http://java.sun.com/jstl/core"
				xmlns:t="http://myfaces.apache.org/tomahawk"
				template="/pages/crud_template.xhtml"> 

	<ui:param name="crudBean" value="#{localPagamentoBean}" />
	
	<ui:define name="requiredFieldsMessage">
		<h:outputText value="#{bundle.todosCamposObrigatorios}" rendered="#{crudBean.updating}"/>
	</ui:define>
	
	<ui:define name="content">
		<!-- Painel de Pesquisa - Inicio -->
		<h:panelGroup id="panelGroupDePesquisa" rendered="#{crudBean.searching}">
			<f:subview id="viewBusca">
				<table>
					<tr>
						<td class="tdCor" width="35%"><h:outputText value="Código"/></td>
						<td class="tdBranco">
							<h:inputText value="#{crudBean.searchObject.codigo}" size="15" maxlength="20" onkeypress="return maiuscula(this)" />
						</td>
					</tr>
					<tr>
						<td class="tdCor" width="25%"><h:outputText value="Descrição"/></td>
						<td class="tdBranco">
							<h:inputText value="#{crudBean.searchObject.descricao}" size="40" maxlength="60" onkeypress="return maiuscula(this)" />
						</td>
					</tr>
					<tr>
						<td class="tdCor"><h:outputText value="Tipo de Conciliação"/></td>
						<td class="tdBranco">
							<table style="width: 300px;">
     		 					<tr>
     		 						<td>
										<h:selectOneRadio value="#{crudBean.searchObject.tipoConciliacao}">
										   <f:selectItem itemValue="0" itemLabel="Todos"/>   
										   <f:selectItem itemValue="1" itemLabel="Analítico"/>   
										   <f:selectItem itemValue="2" itemLabel="Sintético"/>   
										</h:selectOneRadio>                                
									</td>
								</tr>
							</table>
						</td>
					</tr>
					<tr>
						<td class="tdCor"><h:outputText value="Ativo"/></td>
						<td class="tdBranco">
							<table style="width: 200px;">
     		 					<tr>
     		 						<td>
										<h:selectOneRadio value="#{crudBean.searchObject.situacao}">
										   <f:selectItem itemValue="T" itemLabel="Todos"/>   
										   <f:selectItem itemValue="S" itemLabel="Sim"/>   
										   <f:selectItem itemValue="N" itemLabel="Não"/>   
										</h:selectOneRadio>                                
									</td>
								</tr>
							</table>
						</td>
					</tr>
				</table>
			</f:subview>
		</h:panelGroup>
		<!-- Painel de Pesquisa - Fim -->

		<!-- Painel de Cadastro - Inicio -->
		<h:panelGroup id="panelGroupDeCadastro" rendered="#{crudBean.updating}">
			<f:subview id="viewCadastro">
				<table>
					<tr>
						<td class="tdCor" width="35%"><h:outputText value="Código"/> *</td>
						<td class="tdBranco">
							<h:inputText value="#{crudBean.entity.codigo}" size="15" maxlength="20" onkeypress="return maiuscula(this)" />
						</td>
					</tr>
					<tr>
						<td class="tdCor" width="25%"><h:outputText value="Descrição"/> *</td>
						<td class="tdBranco">
							<h:inputText value="#{crudBean.entity.descricao}" size="40" maxlength="60" onkeypress="return maiuscula(this)" />
						</td>
					</tr>
					<tr>
						<td class="tdCor"><h:outputText value="Tipo de Conciliação"/> *</td>
						<td class="tdBranco">
							<table style="width: 300px;">
     		 					<tr>
     		 						<td>
										<h:selectOneRadio value="#{crudBean.entity.tipoConciliacao}">
										   <f:selectItem itemValue="1" itemLabel="Analítico"/>   
										   <f:selectItem itemValue="2" itemLabel="Sintético"/>   
										</h:selectOneRadio>                                
									</td>
								</tr>
							</table>
						</td>
					</tr>
				</table>
				<h:panelGroup id="panelGroupDeEdicao" rendered="#{crudBean.editing}">
					<table>
						<tr>
							<td class="tdCor" width="37%"><h:outputText value="Situação"/> *</td>
							<td class="tdBranco">
								<table style="width: 300px;">
	     		 					<tr>
	     		 						<td>
											<h:selectOneRadio value="#{crudBean.entity.situacao}">
											   <f:selectItem itemValue="S" itemLabel="Ativo"/>   
											   <f:selectItem itemValue="N" itemLabel="Inativo"/>   
											</h:selectOneRadio>                                
										</td>
									</tr>
								</table>
							</td>
						</tr>
					</table>
				</h:panelGroup>
			</f:subview>
		</h:panelGroup>
		<!-- Painel de Cadastro - Fim -->
		
		<!-- Painel de Visualizacao - Inicio -->
		<h:panelGroup id="panelGroupDeView" rendered="#{crudBean.viewing}">
			<f:subview id="viewVisualizar">
				<table>
					<tr>
						<td class="tdCor" width="35%"><h:outputText value="Código"/></td>
						<td class="tdBranco">
							<h:outputText value="#{crudBean.entity.codigo}"/>
						</td>
					</tr>
					<tr>
						<td class="tdCor"><h:outputText value="Descrição"/></td>
						<td class="tdBranco">
							<h:outputText value="#{crudBean.entity.descricao}"/>
						</td>
					</tr>
					<tr>
						<td class="tdCor"><h:outputText value="Tipo de Conciliação"/></td>
						<td class="tdBranco">
							<h:outputText value="#{crudBean.entity.descricaoTipoConciliacao}"/>
						</td>
					</tr>
					<tr>
						<td class="tdCor"><h:outputText value="Ativo"/></td>
						<td class="tdBranco">
							<h:outputText value="#{crudBean.entity.situacao}"/>
						</td>
					</tr>
				</table>
			</f:subview>
		</h:panelGroup>
		<!-- Painel de Cadastro - Fim -->
	</ui:define>
	
	<ui:define name="list">
		<h:panelGroup id="panelGroupDeListagem" rendered="#{crudBean.searching}">
			<f:subview id="viewListagem">
				<rich:dataTable id="tblData" value="#{crudBean.searchResult}" binding="#{crudBean.tblData}" var="rst" style="width: 100%;" rowClasses="par,impar">
               		
               		<rich:column style="text-align: right;" sortBy="#{rst.codigo}">
						<f:facet name="header">
							<h:outputText value="Código" />
						</f:facet>
						<h:outputText value="#{rst.codigo}"/>
					</rich:column>
               		<rich:column style="text-align: left;" sortBy="#{rst.descricao}">
						<f:facet name="header">
							<h:outputText value="Descrição" />
						</f:facet>
						<h:outputText value="#{rst.descricao}"/>
					</rich:column>
               		<rich:column style="text-align: center;" sortBy="#{rst.descricaoTipoConciliacao}">
						<f:facet name="header">
							<h:outputText value="Tipo de Conciliação" />
						</f:facet>
						<h:outputText value="#{rst.descricaoTipoConciliacao}"/>
					</rich:column>
               		<rich:column style="text-align: center;" sortBy="#{rst.situacao}">
						<f:facet name="header">
							<h:outputText value="Situação" />
						</f:facet>
						<h:outputText value="#{rst.situacao}"/>
					</rich:column>
               		<rich:column style="text-align: center;">
						<f:facet name="header">
							<h:outputText value="" />
						</f:facet>
						<a4j:commandLink actionListener="#{crudBean.exibirSelecionado}" ajaxSingle="true" reRender="formulario, panelTitle">
							<h:graphicImage title="Visualizar" value="/imagens/lupa.png" style="border: 0px;"/>
						</a4j:commandLink>
					</rich:column>
               		<rich:column style="text-align: center;">
						<f:facet name="header">
							<h:outputText value="" />
						</f:facet>
						<a4j:commandLink actionListener="#{crudBean.preparaAlterar}" ajaxSingle="true" reRender="formulario, panelTitle">
							<h:graphicImage title="Alterar" value="/imagens/alterar.png" style="border: 0px;"/>
						</a4j:commandLink>
					</rich:column>
					
				</rich:dataTable>
			</f:subview>
		</h:panelGroup>
	</ui:define>
	
</ui:composition>